﻿package mortal.game.view.shopMall.shopSecKilling
{
    import Message.Game.*;
    import flash.utils.*;

    public class ShopSeckillingCache extends Object
    {
        private var _sPanicBuyMsg:SPanicBuyMsg;
        private var _selfBuyRecordDic:Dictionary;
        private var _version:int;

        public function ShopSeckillingCache()
        {
            this._selfBuyRecordDic = new Dictionary();
            return;
        }// end function

        public function set sPanicBuyMsg(param1:SPanicBuyMsg) : void
        {
            if (this._version != param1.version)
            {
                this._selfBuyRecordDic = new Dictionary();
            }
            this._version = param1.version;
            this._sPanicBuyMsg = param1;
            return;
        }// end function

        public function get sPanicBuyMsg() : SPanicBuyMsg
        {
            return this._sPanicBuyMsg;
        }// end function

        public function get curShopInfo() : SPanicBuyShopMsg
        {
            return this._sPanicBuyMsg.panicBuyShop;
        }// end function

        public function get shopCode() : int
        {
            return this._sPanicBuyMsg.panicBuyShop.shopCode;
        }// end function

        public function resetLeftItemAmount(param1:SPanicBuyItemMsg) : void
        {
            this._sPanicBuyMsg.panicBuyItems[param1.itemCode] = param1;
            return;
        }// end function

        public function getLeftItemInfoByCode(param1:int) : SPanicBuyItemMsg
        {
            return this._sPanicBuyMsg.panicBuyItems[param1];
        }// end function

        public function set playerBuyRecord(param1:SPanicBuyPlayerRecordMsg) : void
        {
            var _loc_3:String = null;
            if (this._version != param1.version)
            {
                this._selfBuyRecordDic = new Dictionary();
            }
            this._version = param1.version;
            var _loc_2:* = param1.records;
            for (_loc_3 in _loc_2)
            {
                
                this._selfBuyRecordDic[int(_loc_3)] = _loc_2[_loc_3];
            }
            return;
        }// end function

        public function getSelfBuyRecordByItemCode(param1:int) : int
        {
            var _loc_2:* = this._selfBuyRecordDic[param1];
            return _loc_2;
        }// end function

    }
}
